Skip to content

fix(acp): persist runtime model and mode into assistant preferences#482

Merged
kaizhou-lab merged 1 commit into
mainfrom
fix/acp-config-option-preferences
Jun 17, 2026
Merged

fix(acp): persist runtime model and mode into assistant preferences#482
kaizhou-lab merged 1 commit into
mainfrom
fix/acp-config-option-preferences

Conversation

@kaizhou-lab

Copy link
Copy Markdown
Contributor

Summary

  • Mirror runtime model/mode switches from set_config_option into the persisted assistant snapshot and assistant_preferences so an assistant configured with default_*_mode = auto actually remembers the user's most recent pick across conversations.
  • Skip the write-back unless the agent confirms the change as ObservedCommandAck only acknowledges the request, and unrelated option ids (e.g. thought_level) have no preference mapping.
  • Persistence failures are logged via warn! but do not roll back the user-facing config switch.

Why

Before this change, switching the model inside an ACP conversation reached the running agent through acpConversation.setConfigOption, but that code path forwarded straight to IAgentTask::set_config_option and never touched assistant_preferences.last_*. The next conversation seeded from the same assistant in auto mode therefore re-used the previously persisted value, ignoring the user's most recent pick. The aionrs path already wrote back via ConversationService::update; this brings the ACP path to parity.

Verification

  • cargo test -p aionui-conversation (270 lib + integration tests pass, including 3 new set_config_option_* cases)
  • cargo clippy -p aionui-conversation --tests --no-deps -- -D warnings
  • cargo fmt -p aionui-conversation --check

When users switched the model or mode inside an ACP conversation, the
change reached the running agent through `set_config_option` but never
flowed back into `assistant_preferences.last_*`. The next conversation
seeded from the same assistant in `auto` mode therefore re-used the
previously persisted value, ignoring the user's most recent pick.

Mirror runtime model/mode switches into the persisted assistant
snapshot and preference, but only when the agent confirms the change as
observed — `command_ack` means the request was accepted, not applied,
and unrelated option ids (e.g. `thought_level`) have no preference
mapping. Persistence failures are logged and do not roll back the
user-facing config switch.
@kaizhou-lab kaizhou-lab merged commit b9bcad9 into main Jun 17, 2026
6 checks passed
@kaizhou-lab kaizhou-lab deleted the fix/acp-config-option-preferences branch June 17, 2026 07:21
piorpua pushed a commit that referenced this pull request Jun 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.31](v0.1.30...v0.1.31)
(2026-06-17)


### Features

* **assistant:** add built-in AionUi self-management assistant
([#474](#474))
([eea941e](eea941e))
* **assistant:** expand AionUi assistant into a butler with
remote-access ([#481](#481))
([794c21a](794c21a))
* enforce TeamRun ownership for agent turns
([#483](#483))
([4cc168a](4cc168a))
* **team:** support queued team_send_message semantics
([#479](#479))
([a57a079](a57a079))


### Bug Fixes

* **acp:** persist runtime model and mode into assistant preferences
([#482](#482))
([b9bcad9](b9bcad9))
* harden ACP image path handling
([#477](#477))
([c79b5a8](c79b5a8))
* **team:** retry handoff turns after runtime release
([#480](#480))
([77d252f](77d252f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant